package com.jason.basicandroid.net;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.EditText;

public class HttpDemo extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    public void onBtnShowWebClick(View view) {
    	EditText txUrl = (EditText)findViewById(R.id.txUrl);
        String url = txUrl.getText().toString();
        
        HttpHandler httpHandler = new HttpHandler();                
        String web = httpHandler.executeHttpGet(url);

        WebView webView = (WebView)findViewById(R.id.webview);
        webView.loadDataWithBaseURL(url, web, "text/html", "utf-8", null);
    }
}